<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>编辑学生</title>
    <script src="js/jquery.min.js"></script>
    <style>
        div {
            width: 340px;
            height: 500px;
            margin: 50px auto;
            border: 1px solid #000;
            text-align: center;
        }

        textarea {
            vertical-align: top;
        }

    </style>
</head>
<body>
<div>
    <h3>编辑页面</h3>
    <form action="${base}/editStudentServlet" method="post">
        <input type="hidden" name="id" value="${student.id}">
        <p>
            姓名：<input type="text" name="name" value="${student.name}">
        </p>
        <p>
            学号：<input type="text" name="sno" value="${student.sno}">
        </p>
        <p>
            口令：<input type="text" name="pwd" value="${student.pwd}">
        </p>
        <p>
            生日：<input type="date" name="birthday" value="${birthday}">
        </p>
        <p>
            性别：
            <input type="radio" name="sex" value="1"
            <c:if test="${student.sex==1}">
                   checked="checked"</c:if>>男
            <input type="radio" name="sex" value="0"
            <c:if test="${student.sex==0}">
                   checked="checked"</c:if>>女
        </p>
        <p>
            政治面貌：
            <select name="polity">
                <option value="1"
                        <c:if test="${student.polity==1}">
                            selected="selected"</c:if>>党员
                </option>
                <option value="2"
                        <c:if test="${student.polity==2}">
                            selected="selected"</c:if>>团员
                </option>
                <option value="3"
                        <c:if test="${student.polity==3}">
                            selected="selected"</c:if>>无党派
                </option>
                <option value="4"
                        <c:if test="${student.polity==4}">
                            selected="selected"</c:if>>其它
                </option>
            </select>
        </p>
        <p>
            <span>简介：</span>
            <textarea name="brief" cols="30" rows="10">${student.brief}</textarea>
        </p>
        <p>
            <input type="submit" value="确定">&nbsp;
            <input type="button" value="返回" id="btnBack">
        </p>
    </form>
</div>
<script>
    $(function () {
        let btnBack = $("#btnBack");
        btnBack.click(function () {
            window.history.go(-1);
        });
    });
</script>
</body>
</html>
